import request from '@/config/request'
import lessonApi from './lesson'
import type { EbookForm, EbookBatchItem, EbookBatchForm } from '@/config/forms'

export default {
    getLesson: (lessonId : number) => lessonApi.getItem(lessonId),
    getList: (lessonId : number) => request.get('/backend/lessons/' + lessonId + '/ebooks'),
    create: (form : EbookForm) => request.post('/backend/lessons/ebooks', form),
    createBatch: (form : EbookBatchForm) => request.post('/backend/lessons/ebooks/batch', form),
    delete: (id : number) => request.delete('/backend/lessons/ebooks/' + id),
    onself: (ids: number[], status: boolean) => request.post('/backend/lessons/ebooks/onself', {ids, status}),
}